/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-08 09:56:27
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-18 12:43:53
 * @FilePath: \vue3_admin_template\project\src\api\product\sku\type.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export interface ResponseData {
  code: number
  message: string
  ok: boolean
}
export interface Attr {
  //平台属性收集
  attrId: number | string //平台属性ID
  valueId: number | string //属性值ID
  id?: number
}
export interface saleAttr {
  //销售属性
  saleAttrId: string | number //属性ID
  saleAttrValueId: number | string //属性值Id
  id?: number
}
//定义SKU对象的ts类型
export interface SkuData {
  category3Id?: string | number //三级分裂Id
  spuId?: string | number //已有的SPU的ID
  tmId?: string //spu品牌的ID
  skuName?: string //sku名字
  price?: string | number //sku价格
  weight?: string | number //sku重量
  skuDSc?: string //sku描述
  skuAttrValueList?: Attr[]
  skuSaleAttrValueList?: saleAttr[]
  skuDefaultImg?: string //sku图片地址
  isSale?: number
  id?: number
}
//接口返回的SKU数组
export type Records = SkuData[]
//获取Skus数据的接口ts类型
export interface SkuResponseData extends ResponseData {
  data: {
    records: Records
    size: number
    current: number
    orders: []
    optimizeCountSql: boolean
    hitCount: boolean
    countId: null
    maxLimit: null
    searchCount: boolean
    pages: number
    total: number
  }
}

//获取SKU商品详情返回接口ts类型
export interface SkuInfoData extends ResponseData {
  data: SkuData
}
